﻿package com.webdesign.action;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionContext;
import com.webdesign.dto.UserhomeworkInfoDTO;
import com.webdesign.service.ITbUserhomeworkService;


@Controller("StuCheckHomeworkStateAction")
@Scope("prototype")
public class StuCheckHomeworkStateAction {
	
	private ITbUserhomeworkService iTbUserhomeworkService;
	
	private List<UserhomeworkInfoDTO> homeworks;
	
	/*
	 * 学生查看作业完成情况
	 */
	public String homeworkState(){
		Map<String, Object> session = ActionContext.getContext().getSession();
		//userid,学号
		String userid = (String)session.get("userid");
		homeworks =  iTbUserhomeworkService.homeworkState(userid);
		return "success";
	}
	

	public ITbUserhomeworkService getiTbUserhomeworkService() {
		return iTbUserhomeworkService;
	}


	@Resource(name="TbUserhomeworkService")
	public void setiTbUserhomeworkService(
			ITbUserhomeworkService iTbUserhomeworkService) {
		this.iTbUserhomeworkService = iTbUserhomeworkService;
	}


	public List<UserhomeworkInfoDTO> getHomeworks() {
		return homeworks;
	}


	public void setHomeworks(List<UserhomeworkInfoDTO> homeworks) {
		this.homeworks = homeworks;
	}
	
	
	
}
